package com.etc;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;

import java.text.DateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * Test1Controller文件和    test1.fxml文件要做映射
 */
public class Test1Controller {

    // @FXML修饰 标签， 属性名要和 fxml控件的ID做对应
    @FXML
    Button btn1;
    @FXML
    TextField tf1;

    public void clickbtn1() {
        System.out.println("点击了btn1");
        tf1.setText(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
    }
}
